.class public Lcom/instagram/android/people/c/a;
.super Ljava/lang/Object;
.source "FaceDetectionHelper.java"


# direct methods
.method private static a(Landroid/graphics/RectF;II)Landroid/graphics/RectF;
    .locals 3
    .parameter
    .parameter
    .parameter

    .prologue
    .line 69
    new-instance v0, Landroid/graphics/RectF;

    invoke-direct {v0}, Landroid/graphics/RectF;-><init>()V

    .line 70
    iget v1, p0, Landroid/graphics/RectF;->top:F

    int-to-float v2, p2

    div-float/2addr v1, v2

    iput v1, v0, Landroid/graphics/RectF;->top:F

    .line 71
    iget v1, p0, Landroid/graphics/RectF;->bottom:F

    int-to-float v2, p2

    div-float/2addr v1, v2

    iput v1, v0, Landroid/graphics/RectF;->bottom:F

    .line 72
    iget v1, p0, Landroid/graphics/RectF;->left:F

    int-to-float v2, p1

    div-float/2addr v1, v2

    iput v1, v0, Landroid/graphics/RectF;->left:F

    .line 73
    iget v1, p0, Landroid/graphics/RectF;->right:F

    int-to-float v2, p1

    div-float/2addr v1, v2

    iput v1, v0, Landroid/graphics/RectF;->right:F

    .line 74
    return-object v0
.end method

.method private static a(Landroid/media/FaceDetector$Face;)Landroid/graphics/RectF;
    .locals 7
    .parameter

    .prologue
    .line 51
    new-instance v0, Landroid/graphics/PointF;

    invoke-direct {v0}, Landroid/graphics/PointF;-><init>()V

    .line 52
    invoke-virtual {p0}, Landroid/media/FaceDetector$Face;->eyesDistance()F

    move-result v1

    float-to-int v1, v1

    .line 53
    invoke-virtual {p0, v0}, Landroid/media/FaceDetector$Face;->getMidPoint(Landroid/graphics/PointF;)V

    .line 54
    iget v2, v0, Landroid/graphics/PointF;->x:F

    float-to-int v2, v2

    .line 55
    iget v0, v0, Landroid/graphics/PointF;->y:F

    float-to-int v0, v0

    .line 56
    new-instance v3, Landroid/graphics/RectF;

    int-to-float v4, v2

    div-int/lit8 v5, v1, 0x2

    add-int/2addr v5, v0

    int-to-float v5, v5

    int-to-float v2, v2

    div-int/lit8 v6, v1, 0x2

    add-int/2addr v0, v6

    int-to-float v0, v0

    invoke-direct {v3, v4, v5, v2, v0}, Landroid/graphics/RectF;-><init>(FFFF)V

    .line 57
    iget v0, v3, Landroid/graphics/RectF;->right:F

    int-to-float v2, v1

    add-float/2addr v0, v2

    iput v0, v3, Landroid/graphics/RectF;->right:F

    .line 58
    iget v0, v3, Landroid/graphics/RectF;->left:F

    int-to-float v2, v1

    sub-float/2addr v0, v2

    iput v0, v3, Landroid/graphics/RectF;->left:F

    .line 59
    iget v0, v3, Landroid/graphics/RectF;->top:F

    int-to-float v2, v1

    sub-float/2addr v0, v2

    iput v0, v3, Landroid/graphics/RectF;->top:F

    .line 60
    iget v0, v3, Landroid/graphics/RectF;->bottom:F

    int-to-float v1, v1

    add-float/2addr v0, v1

    iput v0, v3, Landroid/graphics/RectF;->bottom:F

    .line 61
    return-object v3
.end method

.method public static a(Ljava/lang/String;Lcom/instagram/pendingmedia/model/c;)V
    .locals 11
    .parameter
    .parameter

    .prologue
    const/16 v7, 0x14

    .line 27
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v1

    .line 28
    new-instance v0, Landroid/graphics/BitmapFactory$Options;

    invoke-direct {v0}, Landroid/graphics/BitmapFactory$Options;-><init>()V

    .line 29
    sget-object v3, Landroid/graphics/Bitmap$Config;->RGB_565:Landroid/graphics/Bitmap$Config;

    iput-object v3, v0, Landroid/graphics/BitmapFactory$Options;->inPreferredConfig:Landroid/graphics/Bitmap$Config;

    .line 30
    const/4 v3, 0x1

    iput-boolean v3, v0, Landroid/graphics/BitmapFactory$Options;->inPurgeable:Z

    .line 31
    invoke-static {p0, v0}, Landroid/graphics/BitmapFactory;->decodeFile(Ljava/lang/String;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;

    move-result-object v3

    .line 32
    new-array v4, v7, [Landroid/media/FaceDetector$Face;

    .line 33
    new-instance v0, Landroid/media/FaceDetector;

    invoke-virtual {v3}, Landroid/graphics/Bitmap;->getWidth()I

    move-result v5

    invoke-virtual {v3}, Landroid/graphics/Bitmap;->getHeight()I

    move-result v6

    invoke-direct {v0, v5, v6, v7}, Landroid/media/FaceDetector;-><init>(III)V

    .line 35
    invoke-virtual {v0, v3, v4}, Landroid/media/FaceDetector;->findFaces(Landroid/graphics/Bitmap;[Landroid/media/FaceDetector$Face;)I

    move-result v5

    .line 36
    new-instance v6, Ljava/util/ArrayList;

    invoke-direct {v6}, Ljava/util/ArrayList;-><init>()V

    .line 37
    const/4 v0, 0x0

    :goto_0
    if-ge v0, v5, :cond_0

    .line 38
    new-instance v7, Lcom/instagram/pendingmedia/model/FaceBox;

    aget-object v8, v4, v0

    invoke-static {v8}, Lcom/instagram/android/people/c/a;->a(Landroid/media/FaceDetector$Face;)Landroid/graphics/RectF;

    move-result-object v8

    invoke-virtual {v3}, Landroid/graphics/Bitmap;->getWidth()I

    move-result v9

    invoke-virtual {v3}, Landroid/graphics/Bitmap;->getHeight()I

    move-result v10

    invoke-static {v8, v9, v10}, Lcom/instagram/android/people/c/a;->a(Landroid/graphics/RectF;II)Landroid/graphics/RectF;

    move-result-object v8

    invoke-direct {v7, v8}, Lcom/instagram/pendingmedia/model/FaceBox;-><init>(Landroid/graphics/RectF;)V

    .line 40
    invoke-virtual {v6, v7}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 37
    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    .line 42
    :cond_0
    invoke-virtual {p1, v6}, Lcom/instagram/pendingmedia/model/c;->b(Ljava/util/ArrayList;)V

    .line 43
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v3

    .line 44
    const-string v0, "FaceDetectionHelper"

    new-instance v5, Ljava/lang/StringBuilder;

    invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V

    const-string v6, "Time spent in face detection: "

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    sub-long v1, v3, v1

    invoke-virtual {v5, v1, v2}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, " ms"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/facebook/e/a/a;->b(Ljava/lang/String;Ljava/lang/String;)V

    .line 45
    return-void
.end method
